package com.vhall.component.controller.exam.facade;


import com.vhall.component.entity.exam.dto.ExamAnswersDTO;
import com.vhall.component.entity.exam.dto.ExamDTO;
import com.vhall.component.entity.exam.vo.*;
import com.vhall.component.entity.page.vo.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Map;

/**
 * @author guoxin.wang
 * @since 2021/7/19
 */
@FeignClient(value = "ExamApiFacade", path = "/v4/api/exam")
public interface ExamApiFacade {

    /**
     * 考试列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/list")
    PageVO<ExamConsoleListRspVO> list(@Validated ExamConsoleListReqVo vo);

    /**
     * 考试-试卷列表
     *
     * @param vo 试卷编号
     * @return
     */
    @PostMapping("/paper-list")
    PageVO<ExamDTO> paperList(@Validated ExamPaperListReqVo vo);

    /**
     * 考试-批阅列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/grade-list")
    PageVO<ExamAnswersDTO> gradeList(@Validated ExamGradeListReqVo vo);

    /**
     * 试卷-发布
     */
    @PostMapping("/publish")
    Boolean publish(@Validated ExamVo vo);

    /**
     * 观众端考试列表
     */
    @PostMapping("/watch-list")
    PageVO<ExamConsoleListRspVO> watchList(@Validated ExamWatchListReqVo vo);

    /**
     * 考试-已作答
     */
    @PostMapping("/answered-exam")
    PageVO<AnsweredExamResVo> answeredExam(@Validated AnsweredExamReqVo vo);

    /**
     * 考试-删除
     *
     * @param vo
     * @return
     */
    @PostMapping("/delete")
    Boolean delete(@Validated ExamDeleteApiReqVo vo);

    /**
     * 考试-收卷
     *
     * @param examVo exam vo
     * @return
     */
    @PostMapping("/exam-finish")
    Boolean examFinish(@Validated ExamVo examVo);

    /**
     * 直播间-考试-结果公布
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @PostMapping("/grade-push")
    Boolean gradePush(@Validated ExamVo reqVO);

    /**
     * 考卷绑定 - 业务逻辑为复制一份, 并绑定
     *
     * @param vo
     * @return
     */
    @PostMapping("/paper-bind")
    boolean paperBind(@Validated ExamVo vo);

    /**
     * 考试-判卷完成
     *
     * @param examVo exam vo
     * @return
     */
    @PostMapping("/set-grade")
    Boolean setGrade(@Validated ExamVo examVo);

    /**
     * 是否提交过试卷
     */
    @PostMapping("/check-survey")
    Map<String, Boolean> checkSurvey(@Validated ExamVo vo);

}
